<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>图书管理系统</title>
    <link rel="stylesheet" href="styles.css">
    <style>
        body {
            background-color: #E0F7FA;
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
        }

        h1 {
            text-align: center;
            color: #333;
            margin-top: 20px;
        }

        h2 {
            text-align: center;
            color: #555;
            margin-top: 30px;
        }

        form {
            display: flex;
            flex-direction: column;
            align-items: center;
            margin: 20px auto;
            width: 90%;
            max-width: 400px;
        }

        form input,
        form button {
            width: 100%;
            padding: 10px;
            margin: 10px 0;
            font-size: 16px;
            border: 1px solid #ccc;
            border-radius: 5px;
        }

        .blue-button {
            background-color: #007BFF;
            color: white;
            font-weight: bold;
            border: none;
            cursor: pointer;
            transition: background-color 0.3s;
        }

        .blue-button:hover {
            background-color: #0056b3;
        }

        .book-entry {
            border: 1px solid #ddd;
            background-color: white;
            padding: 15px;
            margin: 10px auto;
            border-radius: 10px;
            width: 90%;
            max-width: 500px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }

        .book-entry p {
            margin: 5px 0;
            font-size: 16px;
            color: #333;
        }

        .edit-delete {
            display: flex;
            justify-content: space-evenly;
            margin-top: 15px;
        }

        .edit-delete .blue-button {
            flex: 1;
            margin: 0 5px;
            padding: 8px 0;
        }

        @media (min-width: 768px) {
            form {
                max-width: 500px;
            }

            .book-entry {
                max-width: 700px;
            }
        }
    </style>
</head>

<body>
    <h1>图书管理系统</h1>

    <h2>增加图书</h2>
    <form method="POST">
        <input type="hidden" name="action" value="add">
        <input type="text" name="title" placeholder="书名" required>
        <input type="text" name="author" placeholder="作者" required>
        <input type="text" name="isbn" placeholder="ISBN号" required>
        <input type="date" name="publishedDate" required>
        <button type="submit" class="blue-button">添加图书</button>
    </form>

    <!-- 示例的图书条目 -->
    <div class="book-entry">
        <p><strong>书名:</strong> php开发</p>
        <p><strong>作者:</strong> 王二</p>
        <p><strong>ISBN号:</strong> 22121212122</p>
        <p><strong>出版日期:</strong> 2025-05</p>
        <div class="edit-delete">
            <button class="blue-button">编辑</button>
            <button class="blue-button">删除</button>
        </div>
    </div>

    <div class="book-entry">
        <p><strong>书名:</strong> C++开发</p>
        <p><strong>作者:</strong> 小二</p>
        <p><strong>ISBN号:</strong> 34212121212</p>
        <p><strong>出版日期:</strong> 2025-07</p>
        <div class="edit-delete">
            <button class="blue-button">编辑</button>
            <button class="blue-button">删除</button>
        </div>
    </div>

    <h2>编辑图书</h2>
    <form method="POST">
        <input type="text" name="editTitle" placeholder="书名">
        <input type="text" name="editAuthor" placeholder="作者">
        <input type="text" name="editISBN" placeholder="ISBN号">
        <input type="date" name="editPublishedDate">
        <button type="submit" class="blue-button">更新图书</button>
    </form>
</body>